package team.bluepen.supermarket.data.database.dao;

import space.lingu.light.*;
import team.bluepen.supermarket.data.entity.ProductIdStatusAmount;

import java.util.List;

/**
 * @author RollW
 */
@Dao
public interface ProductIdStatusAmountDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(ProductIdStatusAmount... productIdStatusAmounts);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(List<ProductIdStatusAmount> productIdStatusAmounts);
    
    @Update(onConflict = OnConflictStrategy.REPLACE)
    void update(ProductIdStatusAmount... productIdStatusAmounts);

    @Update(onConflict = OnConflictStrategy.REPLACE)
    void update(List<ProductIdStatusAmount> productIdStatusAmounts);

    @Delete
    void delete(ProductIdStatusAmount ProductIdStatusAmount);
    
    @Delete
    void delete(List<ProductIdStatusAmount> productIdStatusAmounts);

    @Delete("DELETE FROM product_id_status_amount")
    void clearTable();

    @Query("SELECT * FROM product_id_status_amount")
    List<ProductIdStatusAmount> get();
}
